//
//  ShopCarTableViewCell.m
//  Mall
//
//  Created by 孙飞燕 on 16/10/11.
//  Copyright © 2016年 孙飞燕. All rights reserved.
//

#import "ShopCarTableViewCell.h"
#import "GoodsModel.h"
@implementation ShopCarTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];

}
- (void)addTheValue:(GoodsModel *)model{
    self.goodsImage.image = [UIImage imageNamed:model.goodImage];
    self.titleLabel.text = model.goodsTitle;
    self.priceLabel.text = model.goodsPrice;
    self.goodsCount.text = [NSString stringWithFormat:@"%d",model.goodsNumber];

    if (model.selectState) {
        self.selectState = YES;
        [self.selectBtn setImage:[UIImage imageNamed:@"btn_selected"] forState:UIControlStateNormal];
    }else{
        self.selectState = NO;
         [self.selectBtn setImage:[UIImage imageNamed:@"btn_selected_default"] forState:UIControlStateNormal];
    }


}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
//选择按钮的点击方法
- (IBAction)selectBtn:(id)sender {
    if ([self.delegate respondsToSelector:@selector(shopCarTableViewCellDelegate:withSelectButton:)]) {
        [self.delegate shopCarTableViewCellDelegate:self withSelectButton:sender];
    }
}
@end
